package dxunderground.winampController.Common;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class StatusPanel extends JPanel {
	public StatusPanel(GUI gui, ButtonActionsInterface buttonActions) {
		this.setLayout(new BorderLayout());
		JPanel numSongsPanel = new JPanel(new GridLayout(1, 2));
		JLabel songNumber = new JLabel("Number of Songs: ");
		numSongsPanel.add(songNumber);
		gui.statusLabel = new JLabel("0");
		numSongsPanel.add(gui.statusLabel);

		JButton addButton = new JButton("Add to Playlist");
		JButton prevButton = new JButton("<<");
		JButton ppButton = new JButton("||>");
		JButton stopButton = new JButton("[]");
		JButton nextButton = new JButton(">>");
		addButton.addActionListener(buttonActions);
		prevButton.addActionListener(buttonActions);
		ppButton.addActionListener(buttonActions);
		stopButton.addActionListener(buttonActions);
		nextButton.addActionListener(buttonActions);

		JPanel buttonPanel = new JPanel(new GridLayout(1, 4));
		buttonPanel.add(prevButton);
		buttonPanel.add(ppButton);
		buttonPanel.add(stopButton);
		buttonPanel.add(nextButton);

		this.add(numSongsPanel, BorderLayout.WEST);
		this.add(addButton, BorderLayout.EAST);
		this.add(buttonPanel, BorderLayout.SOUTH);
	}
}
